package cn.com.generaldata.jsme_indicator_system.entity;

import java.sql.Timestamp;
import java.util.List;

import lombok.Data;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Many;
import org.nutz.dao.entity.annotation.Table;

import com.google.common.collect.ImmutableList;

/**
 * 核算指标实体
 */
@Data
@Table("t_indicator_accounting")
public class IndicatorAccounting implements java.io.Serializable {

	private static final long serialVersionUID = 5218040157680198546L;

	// columns START
	/**
	 * 主键 db_column: id
	 */
	@Id
	@Column("id")
	private Integer id;
	/**
	 * 指标名称 db_column: name
	 */
	@Column("name")
	private String name;
	/**
	 * 指标代码 db_column: code
	 */
	@Column("code")
	private String code;
	/**
	 * 指标单位 db_column: unit
	 */
	@Column("unit")
	private String unit;
	/**
	 * 计量单位数量级 db_column: unit_magnitude
	 */
	@Column("unit_magnitude")
	private Double unitMagnitude;
	/**
	 * 是否启用 db_column: enabled
	 */
	@Column("enabled")
	private Integer enabled;
	/**
	 * 核算频率 db_column: frequency
	 */
	@Column("frequency")
	private Integer frequency;
	/**
	 * 产业代码 db_column: industry_code
	 */
	@Column("industry_code")
	private String industryCode;
	/**
	 * 海洋产业类别 db_column: marine_industry_category
	 */
	@Column("marine_industry_category")
	private Integer marineIndustryCategory;
	/**
	 * 海洋产业属性 db_column: marine_industry_attr
	 */
	@Column("marine_industry_attr")
	private Integer marineIndustryAttr;
	/**
	 * 公式级别 db_column: level
	 */
	@Column("level")
	private Integer level = 3;
	/**
	 * 公式区域 db_column: section
	 */
	@Column("section")
	private Integer section = 3;
	/**
	 * 核算公式 db_column: formula
	 */
	@Column("formula")
	private String formula;
	/**
	 * 显示核算公式 db_column: show_formula
	 */
	@Column("show_formula")
	private String showFormula;
	/**
	 * 核算指标是否可引用，引用是否代码 db_column: reference
	 */
	@Column("reference")
	private Integer reference = 0;
	/**
	 * 是否显示结果，引用是否代码 db_column: show_result
	 */
	@Column("show_result")
	private Integer showResult = 1;
	/**
	 * 核算指标运算优先级，优先级高的指标先运算 db_column: priority
	 */
	@Column("priority")
	private Integer priority;
	/**
	 * 核算指标的排序序号 db_column: sort_no
	 */
	@Column("sort_no")
	private Integer sortNo;
	/**
	 * 核算指标对应的录入指标id，主要为年鉴或反馈数据 db_column: equal_indicator_input_id
	 */
	@Column("equal_indicator_input_id")
	private Integer equalIndicatorInputId;
	/**
	 * 指标说明 db_column: description
	 */
	@Column("description")
	private String description;
	/**
	 * 创建时间 db_column: create_time
	 */
	@Column("create_time")
	@ColDefine(update = false)
	private java.sql.Timestamp createTime = new Timestamp(System.currentTimeMillis());
	/**
	 * 最后修改时间 db_column: last_update
	 */
	@Column("last_update")
	@ColDefine(insert = false, update = false)
	private java.sql.Timestamp lastUpdate;

	@Many(target = IndicatorAccountingReference.class, field = "indicatorAccountingId")
	private List<IndicatorAccountingReference> references = ImmutableList.of();

	/**
	 * 上一版本指标ID db_column: f_id
	 */
	@Column("f_id")
	private Integer fId;
	// columns END

}
